package com.cy.wangly.springcore.controller;

import com.cy.wangly.springcore.service.TestBeanOne;
import com.cy.wangly.springcore.service.TestBeanTwo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {
    public TestController() {
        System.out.println(" init TestController");
    }

    @Autowired
    private TestBeanOne testBeanOne;
    @Autowired
    private TestBeanTwo testBeanTwo;

    @RequestMapping("/getOne")
    public String getTestBeanOne() {
        testBeanOne.print();
        return "getTestBeanOne";
    }

    @RequestMapping("/getTwo")
    public String getTestBeanTwo() {
        testBeanTwo.print();
        return "getTestBeanTwo";
    }
}
